<?php

defined("_JEXEC") or die("Restricted access");
//khai bao thu vien
jimport("joomla.application.component.controller");
//helloworld controller
class loichaoController extends JController
{
    public function display($cachable = false, $urlparams = false)
{
        $document = JFactory::getDocument();
        $vname = JRequest::getCmd('view','loichao');
        $vformat = $document->getType();
        $lname = JRequest::getcmd('layout','default');
        //$app = & JFactory::getApplication();
        $model = $this->getModel('loichao');
        
        if($view = $this->getView($vname, $vformat))
        {
            switch ($vname)
            {
                case 'loichao':
                    break;
                default :
                    $this->setRedirect(JRoute::_('index.php?option=com_loichao&view=default',FALSE));
            }
            
        }
        
        $view->setModel($model,TRUE);
        $view->setLayout($lname) ;
        
        //
        $view->assignRef('document',$document);
        $view->display();
}
}
?>